var endId = $("#endId").val();
/*
 * @Description: 预加载
 * @param : 
 */
$(function (){
//	console.log(type)
	var data = {};
	data.endId = endId;
//	console.log(data)
	$.ajax({
		url:pathUrl("dispatch/printEndCard.action"),
		type:'POST',
		dataType:'JSON',
		async : false,
		data:data,
		success:function(data){
//			console.log(data)
			var str = "",title;
			data = data.rows;
			var key, value;
			for (x in data) {//往span里写值
				key = x;
				value = data[x] == null?"":data[x];
				if(x == 'fStartTime' || x == 'fEndTime' || x == 'fDate'){
					value = dateFormatter(data[x]);
				}
				$("#"+key).text(value);
			}
		}
	});
	setTimeout(function(){
		print();
	}, 500);
});

/*
 * @Description: 打印
 * @param :
 */
function print() {
	/*var canvas=document.getElementsByTagName("canvas")[0];
	var dataURL = canvas.toDataURL("image/png");
	var img = '<img src="'+dataURL+'"></img>';
	$("#qrcode").html(img);*/
	$(".row").print({
		deferred: $.Deferred().done(function() { 
			window.close(); 
		})//打印完后自动关闭打印页面
	});
}